package com.huawei.appmarket.service.deamon.bean;

import android.text.TextUtils;
import com.huawei.appgallery.downloadengine.api.SessionDownloadTask;
import com.huawei.appgallery.foundation.storage.db.RecordBean;
import java.io.Serializable;
import java.util.Comparator;
import o.dmt;

public class DownloadHistory extends RecordBean implements Comparator<DownloadHistory>, Serializable {
    private static final String TABLE_NAME = "DownloadHistory";
    private static final long serialVersionUID = 1;
    private String accessId_ = null;
    private String appID_;
    private int appType_ = 1;
    private long createTime;
    private String detailID_;
    private int dlType_ = 0;
    private String extend_ = null;
    private String extraParam_ = null;
    private long fielSize_;
    private String iconUrl_;
    private String initParam_ = null;
    private int installType_ = 0;
    private int maple_;
    private String name_;
    private String packageName_;
    private int serviceType_;
    private long sessionId_;
    private int status_ = 0;
    private long taskSubmitTime_ = 0;
    private String universalUrl_;
    private int versionCode_;
    private String wishWallReplyId_;

    public /* synthetic */ int compare(Object obj, Object obj2) {
        return ˎ((DownloadHistory) obj, (DownloadHistory) obj2);
    }

    public DownloadHistory(SessionDownloadTask sessionDownloadTask) {
        this.sessionId_ = sessionDownloadTask.ʾ();
        this.packageName_ = sessionDownloadTask.ˊˊ();
        this.status_ = sessionDownloadTask.ˈ();
        this.installType_ = sessionDownloadTask.ˊॱ();
        this.versionCode_ = sessionDownloadTask.ॱᐝ();
        this.dlType_ = sessionDownloadTask.ˌ();
        this.detailID_ = sessionDownloadTask.ॱˊ();
        this.extend_ = sessionDownloadTask.ᐧ();
        this.name_ = sessionDownloadTask.ʿ();
        this.iconUrl_ = sessionDownloadTask.ˎˎ();
        this.appID_ = sessionDownloadTask.ॱˋ();
        this.maple_ = sessionDownloadTask.ˋ();
        this.fielSize_ = sessionDownloadTask.ˊˋ();
        this.accessId_ = sessionDownloadTask.ॱͺ();
        this.extraParam_ = sessionDownloadTask.ॱʼ();
        this.serviceType_ = sessionDownloadTask.ॱ();
        this.universalUrl_ = sessionDownloadTask.ᐝ();
        this.appType_ = sessionDownloadTask.ॱॱ();
        this.wishWallReplyId_ = sessionDownloadTask.ˊ();
        this.initParam_ = sessionDownloadTask.ᐨ();
        this.taskSubmitTime_ = sessionDownloadTask.ˋˋ();
    }

    public SessionDownloadTask ˎ() {
        SessionDownloadTask sessionDownloadTask = new SessionDownloadTask();
        sessionDownloadTask.ˎ(this.sessionId_);
        sessionDownloadTask.ʼ(this.packageName_);
        sessionDownloadTask.ॱॱ(this.status_);
        sessionDownloadTask.ˏ(this.installType_);
        sessionDownloadTask.ʻ(this.versionCode_);
        sessionDownloadTask.ˋॱ(this.dlType_);
        sessionDownloadTask.ˏ(this.detailID_);
        sessionDownloadTask.ॱˊ(this.extend_);
        sessionDownloadTask.ॱॱ(this.name_);
        sessionDownloadTask.ʽ(this.iconUrl_);
        sessionDownloadTask.ॱ(this.appID_);
        sessionDownloadTask.ॱ(this.maple_);
        sessionDownloadTask.ॱ(this.fielSize_);
        sessionDownloadTask.ˋॱ(this.accessId_);
        sessionDownloadTask.ͺ(this.extraParam_);
        sessionDownloadTask.ˊ(this.serviceType_);
        sessionDownloadTask.ˊ(this.universalUrl_);
        sessionDownloadTask.ˎ(this.appType_);
        sessionDownloadTask.ˎ(this.wishWallReplyId_);
        sessionDownloadTask.ˏॱ(this.initParam_);
        sessionDownloadTask.ˊ(this.taskSubmitTime_);
        sessionDownloadTask.ˏ(this.fielSize_);
        return sessionDownloadTask;
    }

    public String ॱ(String str) {
        if (TextUtils.isEmpty(this.extend_) || TextUtils.isEmpty(str)) {
            return null;
        }
        return (String) dmt.ˊ(this.extend_).get(str);
    }

    public void ॱ() {
        this.createTime = System.currentTimeMillis();
    }

    public String t_() {
        return TABLE_NAME;
    }

    public int ˎ(DownloadHistory downloadHistory, DownloadHistory downloadHistory2) {
        if (downloadHistory == null || downloadHistory2 == null) {
            return 0;
        }
        if (downloadHistory.createTime > downloadHistory2.createTime) {
            return -1;
        }
        if (downloadHistory.createTime == downloadHistory2.createTime || downloadHistory.createTime >= downloadHistory2.createTime) {
            return 0;
        }
        return 1;
    }

    public long ˊ() {
        return this.sessionId_;
    }

    public String ˋ() {
        return this.packageName_;
    }

    public int ʻ() {
        return this.status_;
    }

    public void ˏ(int i) {
        synchronized (this) {
            this.status_ = i;
        }
    }

    public int ʼ() {
        return this.installType_;
    }

    public int ॱॱ() {
        return this.versionCode_;
    }

    public int ʽ() {
        return this.dlType_;
    }

    public String ᐝ() {
        return this.detailID_;
    }

    public String ˏॱ() {
        return this.name_;
    }

    public String ˊॱ() {
        return this.iconUrl_;
    }

    public long ͺ() {
        return this.taskSubmitTime_;
    }
}
